#include<stdio.h>
#include<unistd.h>
#include<fcntl.h>
#include<string.h>
int main(){
    //打开命名管道文件
    int fd = open("../fifo",O_WRONLY);
    if(fd < 0){
        perror("open");
        return 0;
    }
    //往管道中写
    while(1){
        const char* buf = "I am write process";
        write(fd, buf, strlen(buf));
        sleep(1);
    }
    close(fd);
    return 0;
}
